#include <head.h>

int main(int argc, char const *argv[])
{
    int fd = open("01test.txt", O_RDWR | O_TRUNC | O_CREAT, 0600);//文件权限为rw-rw-r--，因为umask默认为002
    
    OPEN_ERR(fd);

    printf("fd = %d\n", fd);//fd = 3 因为标准输入输出错误流占用0,1,2

    close(fd);
    return 0;
}   

